{% extends "GairalAdminBundle::layout.html.twig" %}

{% block bodyAdmin %}
<section id="imageAdmin" class="content">

    <h1>Image galery</h1>
    <div class="row-fluid text-center">
        <div class="modal hide" id="addImage">
            <div class="modal-header"> <a class="close" data-dismiss="modal">×</a>
                <h3>Add new image</h3>
            </div>
            {{ render(controller("GairalAdminBundle:ImageAdmin:add")) }}
        </div>
        <div class="btn-toolbar">
            <a href="#addImage" data-toggle="modal" class="btn btn-large btn-primary">
                Add new Image
                <i class="icon-white icon-plus"></i>
            </a>
        </div>
    </div>
    <div class="row-fluid">
        <ul class="thumbnails">
    {% for image in listImages %}
                <li class="thumbnail text-center">
                    <span>{{ image.name }}</span>
                    <img src="{{ asset(image.webPath) }}" alt="{{ image.name }}" style="max-height:100px;"/>
                    <div class="btn-toolbar">
                        <a href="#remove_{{image.id}}" data-toggle="modal" class="btn btn-small btn-danger">
                            Remove
                            <i class="icon-white icon-trash"></i>
                        </a>
                    </div>
                    <div class="modal hide" id="remove_{{image.id}}">
                        <div class="modal-header"> <a class="close" data-dismiss="modal">×</a>
                            <h3>Remove image</h3>
                        </div>
                        <div class="modal-body alert">
                            <p>
                                Are you sure to want to remove the Image: "{{ image.name }}" ?
                            </p>
                        </div>
                        <div class="modal-footer">
                            <a href="{{ path('AdminImage') }}" class="btn btn-info" data-dismiss="modal">
                                Cancel
                            </a>
                            <a href="{{ path('AdminImageRemove', {'id': image.id})}}" class="btn btn-danger">
                                Remove
                                <i class="icon-white icon-trash"></i>
                            </a>
                        </div>                    
                    </div>
                </li>
    {% else %}
                no image
    {% endfor %}
            </ul>
        </div>
    </section>
{% endblock %}